home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / RSF72 / RSF72.INS < prev    next >
Encoding:
Text File  |  1995-09-25  |  10.0 KB  |  281 lines

  1. /* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */
  2. /*****************************************************************************
  3.   NAME
  4.     rsf72.ins - Win95 V3 installation script for ORACLE Required Support Files.
  5.  
  6.   DESCRIPTION
  7.     This script installs the RSF files.
  8.  
  9.   OWNER
  10.  
  11.   MODIFIED    DD-MMM-YY Reason
  12.  
  13. *****************************************************************************/
  14. {
  15.   /**************************************************************************
  16.       Start main logic...
  17.    **************************************************************************/
  18.  
  19.   if (doit)
  20.     {
  21.       ins_ratchet = "7.2.2.3.1";
  22.  
  23.       execute("%installer_home%\win95.ins");
  24.      
  25.       permit_retry_operations = FALSE;
  26.  
  27.       ui_action( instantiate(installing_sys) );
  28.       while(not(empty(copy_list)))
  29.       {
  30.         file_to_copy = first(copy_list);
  31.     { copy(sys, file_to_copy); }
  32.         ['default: continue();]
  33.         copy_list = rest(copy_list);
  34.       }
  35.       permit_retry_operations = TRUE;
  36.  
  37.       ui_action(instantiate(installing_scripts));
  38.       copy(deinstl);
  39.  
  40.       ui_action(instantiate(installing_dlls));
  41.  
  42.       /*******************************************************************
  43.             Install DLLs
  44.        *******************************************************************/
  45.  
  46.       tmplist = bin_overwrite;
  47.       while(not(empty(tmplist)))
  48.         {
  49.           filename = first(explode(first(tmplist),"."));
  50.           move_file("%filename%.dll","%filename%.tmp");
  51.           tmplist = rest(tmplist);          
  52.         } 
  53.  
  54.       copy(dll);
  55.  
  56.       {
  57.         while(not(empty(bin_overwrite))) 
  58.           {
  59.             filename = first(explode(first(bin_overwrite),"."));
  60.             copy_file("%filename%.tmp","%filename%.dll");
  61.             remove_file("%filename%.tmp");
  62.             bin_overwrite = rest(bin_overwrite);
  63.           }
  64.         while(not(empty(path_overwrite)))
  65.           {
  66.             filename = file_name(first(path_overwrite));
  67.             copy_file(first(path_overwrite),"%oracle_home%\bin\%filename%");
  68.             path_overwrite = rest(path_overwrite);
  69.           }
  70.       }  
  71.          [ 'PERMISSION_DENIED:
  72.            {
  73.              error = permission_denied;
  74.              information_dialog(instantiate(cannot_copy));
  75.              signal('CANNOT_COPY,installation_aborted);
  76.            }
  77.           'OS_ERROR:
  78.            {
  79.              error = os_error;
  80.              information_dialog(instantiate(cannot_copy));
  81.              signal('CANNOT_COPY,installation_aborted);
  82.            }
  83.           'WRITE_ERROR:
  84.            {
  85.              error = write_error;
  86.              information_dialog(instantiate(cannot_copy));
  87.              signal('CANNOT_COPY,installation_aborted);
  88.            }
  89.          ]
  90.  
  91.       ui_action(instantiate(installing_nls));
  92.       copy(nlsfiles);
  93.  
  94.       ui_action(instantiate(installing_sql));
  95.       copy(sql);
  96.  
  97.       ui_action(instantiate(installing_msbs));
  98.       copy(msg, nls_abbreviation);
  99.  
  100.  
  101.  
  102.       /**********************************************************************
  103.           Rename the extra copies of DLLs user selected
  104.        **********************************************************************/
  105.  
  106.       permit_retry_operations = FALSE;
  107.       /* set to false because the while loop causes the retry dialog to reappear
  108.         even though the user selects ignore */
  109.       while(not(empty(rename_list)))
  110.         {
  111.          tmplist = first(rename_list);
  112.          rename_list = rest(rename_list);
  113.          while (not(empty(tmplist)))
  114.            {
  115.              old_dll = first(tmplist);
  116.              tmplist = rest(tmplist);
  117.              old_dll_dir = directory_name(old_dll);
  118.              filebase = first(explode(file_name(old_dll),"."));
  119.              target_old = replace("%old_dll_dir%\%filebase%.OLD", "\\", "\");
  120.              move_file(old_dll,target_old); /* rename */
  121.              if (exists(old_dll))
  122.                signal('PERMISSION_DENIED,"");
  123.            } [ 'PERMISSION_DENIED:
  124.              {
  125.                error = permission_denied;
  126.                information_dialog(instantiate(cannot_rename));
  127.                signal('CANNOT_RENAME,installation_aborted);
  128.              }
  129.                'OS_ERROR:
  130.              {
  131.                error = os_error;
  132.                information_dialog(instantiate(cannot_rename));
  133.                signal('CANNOT_RENAME,installation_aborted);
  134.              }
  135.                'WRITE_ERROR:
  136.              {
  137.                error = write_error;
  138.                information_dialog(instantiate(cannot_rename));
  139.                signal('CANNOT_RENAME,installation_aborted);
  140.              } ]
  141.         }
  142.         /*******************************************************************
  143.              Document those extra copies user decide not to rename
  144.         ********************************************************************/
  145.  
  146.         while(not(empty(write_to_file_list)))
  147.           {  
  148.             tmplist = first(write_to_file_list);
  149.             write_to_file_list = rest(write_to_file_list);
  150.             ui_action(instantiate(writing_dlls_txt));
  151.             if (old_dlls_txt=="")
  152.               { /* if file not started */
  153.                 old_dlls_txt = "%oracle_home%\rsf_dlls.txt"; /* if not, delete any previous */
  154.                 remove_file(old_dlls_txt); /* versions of this file */
  155.                 modify("",instantiate(head_message),old_dlls_txt);
  156.               }
  157.               modify("","",old_dlls_txt);
  158.               modify("","-------------------------------------------------------------", old_dlls_txt);
  159.               modify("",instantiate(header_message),old_dlls_txt);
  160.               modify("","",old_dlls_txt);
  161.  
  162.               while (not(empty(tmplist)))
  163.                 {
  164.                   current = first(tmplist);
  165.                   tmplist = rest(tmplist);
  166.                   modify("",current,old_dlls_txt);
  167.                 }
  168.               modify("","-------------------------------------------------------------",old_dlls_txt);
  169.           } [ 'PERMISSION_DENIED,'WRITE_ERROR,'OS_ERROR:
  170.               /* can't modify old_dlls_txt */
  171.               {
  172.                 information_dialog(instantiate(mod_problem),
  173.                                    mod_content,
  174.                                    instantiate(mod_help));
  175.                 break();
  176.               }
  177.             ]
  178.        permit_retry_operations = TRUE;
  179.        /**********************************************************************
  180.           Continue with the installation.  Modify Config...
  181.         **********************************************************************/
  182.  
  183.        if (set_rdbms72)
  184.          {
  185.            ui_action(instantiate(modifying_config));
  186.        modify("RDBMS72",rdbms72,ora_config,(product_filename(current_product)));
  187.          }
  188.  
  189.        if (set_plsql22)
  190.          {
  191.            ui_action(instantiate(modifying_config));
  192.        modify("PLSQL22",plsql22,ora_config,(product_filename(current_product)));
  193.          }
  194.  
  195.        if (set_pro17)
  196.          {
  197.            ui_action(instantiate(modifying_config));
  198.            modify("PRO17",pro17,ora_config,(product_filename(current_product)));
  199.          }
  200.  
  201.        if (set_nlsrtl31)
  202.          {
  203.            ui_action(instantiate(modifying_config));
  204.            modify("NLSRTL31",nlsrtl31,ora_config,(product_filename(current_product)));
  205.          }
  206.  
  207.        if (set_ora_nls)
  208.          {
  209.            ui_action(instantiate(modifying_config));
  210.            modify("ORA_NLS",ora_nls,ora_config,(product_filename(current_product)));
  211.          }
  212.  
  213.        ui_action(instantiate(registering));
  214.        register(current_product);
  215.        if (member(selected_products,current_product))
  216.          reference(current_product);
  217.  
  218.     /**************************************************************************
  219.       Add BIN to path?...
  220.     **************************************************************************/
  221.  
  222.     if (add_bin_to_path)
  223.       {
  224.         ui_action(identifying_bt_drive);
  225.         boot_drive = first(explode(nt_system_root(),":"));
  226.  
  227.         autoexec_bat = "%boot_drive%:\AUTOEXEC.BAT";
  228.         autoexec_old = "%boot_drive%:\AUTOEXEC.OLD";
  229.  
  230.         if (exists(autoexec_bat))
  231.           copy_file(autoexec_bat,autoexec_old);
  232.         else
  233.           create_file(autoexec_bat);
  234.           
  235.         permit_retry_operations = FALSE;
  236.         {
  237.           path_variable = "SET PATH";
  238.           separator = " = ";
  239.           autoexec_path = translate(path_variable,autoexec_bat,separator);
  240.         } [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  241.            {
  242.              path_variable = "PATH";
  243.              {
  244.                autoexec_path = translate(path_variable,
  245.                                          autoexec_bat,separator);
  246.              } [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  247.                 {
  248.                   separator = " ";
  249.                   {
  250.                     autoexec_path = translate(path_variable,autoexec_bat,
  251.                                               separator);
  252.                   } [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  253.                      {
  254.                        autoexec_path = "";
  255.                        continue();
  256.                      } ]
  257.                 } ]
  258.            } ]
  259.         permit_retry_operations = TRUE;
  260.         if (member(explode(autoexec_path,";"),oracle_home_bin))
  261.           information_dialog(instantiate(pth_problem_prompt),
  262.                              pth_problem_content,
  263.                              instantiate(pth_problem_help));
  264.         else
  265.           {
  266.             autoexec_path = "%oracle_home_bin%;%autoexec_path%";
  267.             autoexec_path = implode(explode(autoexec_path,";"),";");
  268.             autoexec_path = "%autoexec_path%;";
  269.             len = length(autoexec_path);
  270.             if (len > 127)
  271.               additional_changes_help = grter_path_length;
  272.             else
  273.               additional_changes_help = "";
  274.             modify(path_variable,autoexec_path,autoexec_bat,separator);
  275.             signal('FAILURE,autoexec_was_changed);
  276.          }
  277.       }
  278.     permit_retry_operations = FALSE;
  279.     }
  280. }
  281.